//
//  ActivityGoalsOfLastSevenDaysCurrentTotalItem.swift
//  DaRings
//
//  Created by 魔样科技 on 2022/11/1.
//

import Foundation
import MYModule

class ActivityGoalsOfLastSevenDaysCurrentTotalItem:StackView {
    
    override func makeUI() {
        super.makeUI()
        
        let subStack = StackView()
        subStack.axis = .horizontal
        subStack.alignment = .center
        subStack.contentMode = .center
        subStack.spacing = 7

        subStack.addArrangedSubview(self.iconImageView)
        self.iconImageView.snp.makeConstraints { make in
            make.width.height.equalTo(14)
        }
        subStack.addArrangedSubview(self.numLabel)
        
        self.spacing = 3
        self.axis = .vertical
        self.alignment = .center
        self.contentMode = .center
        
        self.addArrangedSubview(self.titleLabel)
        self.addArrangedSubview(subStack)
        self.addArrangedSubview(self.unitLabel)
        
        self.numLabel.text = "--"
        self.unitLabel.text = "/--"
        self.titleLabel.text = ""
    }
    
    //MARK: - lazy load -
    lazy var iconImageView: ImageView = {
        let imageView = ImageView()
        imageView.contentMode = .scaleAspectFit
        return imageView
    }()

    lazy var numLabel: Label = {
        let label = Label()
        label.font = Fonts.boldSystemFont(ofSize: 16)
        label.textColor = UIColor.assist_222222
        return label
    }()
    
    lazy var unitLabel: Label = {
        let label = Label()
        label.font = Fonts.systemFont(ofSize: 10)
        label.textColor = UIColor.assist_A9A9A9
        return label
    }()
    
    lazy var titleLabel: Label = {
        let label = Label()
        label.font = Fonts.systemFont(ofSize: 12)
        label.textColor = UIColor.assist_A9A9A9
        label.textAlignment = .center
        return label
    }()
}
